Formatting Numeric Output

Introduction

The banded report in the previous example shows the sum of salaries without any formatting (without dollar signs or commas).  Instead of printing “Total Sum of Employee Salaries = 1923000" in the summary band, we want to print it as $1,923,000.00.

To format the output, you need to edit the field within the banded report editor.  Right-click the field to be formatted to bring up the Edit Expression Field dialog:

This is the Edit Expression Field dialog with the SUM function entered into the Expression field.

Selecting/Creating the Format Mask

To format the field, click the ellipsis button to the right of “Format” which brings up the Edit Format Mask dialog (shown below) that provides options for formatting both numeric and date fields. 

You can select one of the pre-existing formats or create your own mask.  To select one of the pre-existing formats, double-click the desired format shown within the lower window.   The selected option will then appear in the box at the bottom of the window as shown below.  You can also create your own format by using the formatting characters described at the top of the Edit Format Mask dialog box.

Choose one of the existing formats (double-click) or enter your desired mask in the text box at the bottom of the Edit Format Mask dialog.

Edit Format Mask Dialog box with one of the common formats selected.  The selected format includes dollar sign and comma.

The field being edited will then be displayed using the format chosen.

However, the example above needs to be modified in order to use the formatting since the field containing the sum also contains a leading string “Total Sum of Employee Salaries”.  Argos cannot format the entire field since the expression also contains a string.

Therefore the leading string must be separated from the SUM, and only the SUM field should be formatted.

This image shows the format string for the Total Sum of Employees salary.  It includes the format selected in the previous step.

To accomplish this, edit the field above to remove the leading string.  Then apply the format to the SUM function.   To replace the leading string you will need to add a new text field and position it immediately to the left of the SUM function.  

The figure below shows that there are now two separate fields (the leading string and the SUM field). 

This image shows the Employee Total and Employee Salary String separated into two strings each.  The first part of the string contains the label and the second part contains the numeric information.

The new fields will print as shown below and contains the dollar sign and commas:

This image shows the report with the salary field containing dollar signs and commas.

The same procedure can be used to format the Sum of Employees’ Salaries within the Group Footer Band.